package eteam.aps.systeminterface.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.GroupSequence;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(value = "职员信息")
@GroupSequence({Insert.class, Update.class, EmpDto.class})
public class EmpDto implements Serializable {
    @ApiModelProperty("职员ID")
    @NotBlank(message = "职员ID为空", groups = Update.class)
    public String fempid;
    @ApiModelProperty("单位ID")
    @NotBlank(message = "单位ID为空", groups = {Insert.class, Update.class})
    public String forgid;
    @ApiModelProperty("单位名称")
    @NotBlank(message = "单位名称为空", groups = {Insert.class, Update.class})
    public String forgname;
    @ApiModelProperty("部门ID")
    //@NotBlank(message = "部门ID为空", groups = {Insert.class, Update.class})
    public String fdeptid;
    @ApiModelProperty("部门名称")
    //@NotBlank(message = "部门名称为空", groups = {Insert.class, Update.class})
    public String fdeptname;
    @ApiModelProperty("职员编号")
    @NotBlank(message = "职员编号为空", groups = {Insert.class, Update.class})
    public String fcode;
    @ApiModelProperty("职员姓名")
    @NotBlank(message = "职员姓名为空", groups = {Insert.class, Update.class})
    public String fname;
    @ApiModelProperty("性别 -1 不知道 0 女 1 男")
    @NotNull(message = "性别不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "性别不合法", groups = {Insert.class, Update.class})
    @Min(value = -1, message = "性别不合法", groups = {Insert.class, Update.class})
    public Integer fsex = 0;

    @ApiModelProperty("出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date fbirthday;
    @ApiModelProperty("身份证号")
    public String fidcardno;
    @ApiModelProperty("职务")
    public String fduty;
    @ApiModelProperty("职位")
    public String ftitle;
    @ApiModelProperty("职级")
    public String fdutylevel;
    @ApiModelProperty("邮政编码")
    public String fpostcode;
    @ApiModelProperty("地址")
    public String faddress;
    @ApiModelProperty("电话")
    public String ftel;
    @ApiModelProperty("手机")
    public String fmobile;
    @ApiModelProperty("email")
    public String femail;
    @ApiModelProperty("传真")
    public String ffax;
    @ApiModelProperty("紧急联络人")
    public String flinkman;
    @ApiModelProperty("联系人电话")
    public String flinkmantel;
    @ApiModelProperty("入职日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date fjoindate;
    @ApiModelProperty("离职日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date fdimissiondate;
    @ApiModelProperty("备注")
    public String fremark;

    @ApiModelProperty("是否是系统用户")
    @NotNull(message = "用户类型不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "用户类型不合法", groups = {Insert.class, Update.class})
    @Min(value = 0, message = "用户类型不合法", groups = {Insert.class, Update.class})
    public Integer fissysuser;
    @ApiModelProperty("状态【-1删除 0停用 1启用】")
    @NotNull(message = "状态不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "状态不合法", groups = {Insert.class, Update.class})
    @Min(value = -1, message = "状态不合法", groups = {Insert.class, Update.class})
    public Integer state;
}
